{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python_defaultSpec_1600513669029",
   "display_name": "Python 3.8.2 64-bit"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "source": [
    "## Install\n",
    "\n",
    "```bash\n",
    "pip install pdb-profiling\n",
    "```\n",
    "\n",
    "## Import Modules"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pdb_profiling.fetcher.webfetch import UnsyncFetch\n",
    "from pdb_profiling.utils import DisplayPDB\n",
    "from pdb_profiling.processers.pdbe.api import *\n",
    "from pdb_profiling.processers.pdbe.record import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Other packages\n",
    "from pprint import pprint\n",
    "from unsync import unsync"
   ]
  },
  {
   "source": [
    "## Basic Setting"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Use Existing Handled PDBe API Results (e.g. tsv format results)\n",
    "ProcessPDBe.use_existing = True\n",
    "# Init PDBe API Logger\n",
    "ProcessPDBe.init_logger()\n",
    "# Use Existing API Results (e.g. json format results downloaded from web)\n",
    "UnsyncFetch.use_existing = True\n",
    "# Init WebFetcher's Logger (pass it with PDBe API Logger)\n",
    "UnsyncFetch.init_setting(ProcessPDBe.logger)\n",
    "# Set WebFetcher's Semaphore\n",
    "PDB.set_web_semaphore(30)\n",
    "# Set Folder that store downloaded and handled files\n",
    "PDB.set_folder('../test/')\n",
    "# Init ModelServer API's Logger (pass it with PDBe API Logger)\n",
    "PDBeModelServer.init_logger(logger=ProcessPDBe.logger)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "{'api/mappings/all_isoforms/',\n 'api/pdb/entry/assembly/',\n 'api/pdb/entry/binding_sites/',\n 'api/pdb/entry/carbohydrate_polymer/',\n 'api/pdb/entry/cofactor/',\n 'api/pdb/entry/drugbank/',\n 'api/pdb/entry/electron_density_statistics/',\n 'api/pdb/entry/experiment/',\n 'api/pdb/entry/files/',\n 'api/pdb/entry/ligand_monomers/',\n 'api/pdb/entry/modified_AA_or_NA/',\n 'api/pdb/entry/molecules/',\n 'api/pdb/entry/mutated_AA_or_NA/',\n 'api/pdb/entry/observed_residues_ratio/',\n 'api/pdb/entry/polymer_coverage/',\n 'api/pdb/entry/related_experiment_data/',\n 'api/pdb/entry/residue_listing/',\n 'api/pdb/entry/secondary_structure/',\n 'api/pdb/entry/status/',\n 'api/pdb/entry/summary/',\n 'api/pisa/interfacedetail/',\n 'api/pisa/interfacelist/',\n 'swissmodel/repository/uniprot/'}"
     },
     "metadata": {},
     "execution_count": 4
    }
   ],
   "source": [
    "# Availiable api(s) that can be passed to `PDB.fetch_from_web_api`\n",
    "API_SET"
   ]
  },
  {
   "source": [
    "## Demo Usage"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "pdb_demo_existing = PDB('1m4x')\n",
    "pdb_demo_new = PDB('1m11')"
   ]
  },
  {
   "source": [
    "### Fetch Data From PDBe API\n",
    "\n",
    "#### Properties (Implicit implementation)\n"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "{'entry_authors': 'Nandhagopal, N., Simpson, A.A., Gurnon, J.R., Yan, X., '\n                  'Baker, T.S., Graves, M.V., Van Etten, J.L., Rossmann, M.G.',\n 'experimental_method': 'ELECTRON MICROSCOPY',\n 'experimental_method_class': 'em',\n 'obsoletes': [],\n 'since': '20021204',\n 'status_code': 'REL',\n 'superceded_by': [],\n 'title': 'PBCV-1 virus capsid, quasi-atomic model'}\nCPU times: user 0 ns, sys: 0 ns, total: 0 ns\nWall time: 30.5 ms\n{'assemblies': [{'assembly_id': '1',\n                 'form': 'homo',\n                 'name': '5040-mer',\n                 'preferred': True},\n                {'assembly_id': '2',\n                 'form': 'homo',\n                 'name': '84-mer',\n                 'preferred': False},\n                {'assembly_id': '3',\n                 'form': 'homo',\n                 'name': '420-mer',\n                 'preferred': False},\n                {'assembly_id': '4',\n                 'form': 'homo',\n                 'name': '504-mer',\n                 'preferred': False},\n                {'assembly_id': '5',\n                 'form': 'homo',\n                 'name': '90-mer',\n                 'preferred': False},\n                {'assembly_id': '6',\n                 'form': 'homo',\n                 'name': '198-mer',\n                 'preferred': False},\n                {'assembly_id': '7',\n                 'form': 'homo',\n                 'name': '84-mer',\n                 'preferred': False}],\n 'deposition_date': '20020705',\n 'deposition_site': 'RCSB',\n 'entry_authors': ['Nandhagopal, N.',\n                   'Simpson, A.A.',\n                   'Gurnon, J.R.',\n                   'Yan, X.',\n                   'Baker, T.S.',\n                   'Graves, M.V.',\n                   'Van Etten, J.L.',\n                   'Rossmann, M.G.'],\n 'experimental_method': ['Electron Microscopy'],\n 'experimental_method_class': ['em'],\n 'number_of_entities': {'carbohydrate_polymer': 0,\n                        'dna': 0,\n                        'dna/rna': 0,\n                        'ligand': 0,\n                        'other': 0,\n                        'polypeptide': 1,\n                        'rna': 0,\n                        'sugar': 0,\n                        'water': 0},\n 'processing_site': 'RCSB',\n 'related_structures': [],\n 'release_date': '20021204',\n 'revision_date': '20191113',\n 'split_entry': [],\n 'title': 'PBCV-1 virus capsid, quasi-atomic model'}\nCPU times: user 0 ns, sys: 0 ns, total: 0 ns\nWall time: 11 ms\n{'entry_authors': 'He, Y., Lin, F., Chipman, P.R., Bator, C.M., Baker, T.S., '\n                  'Shoham, M., Kuhn, R.J., Medof, M.E., Rossmann, M.G.',\n 'experimental_method': 'ELECTRON MICROSCOPY',\n 'experimental_method_class': 'em',\n 'obsoletes': [],\n 'since': '20020828',\n 'status_code': 'REL',\n 'superceded_by': [],\n 'title': 'structural model of human decay-accelerating factor bound to '\n          'echovirus 7 from cryo-electron microscopy'}\nCPU times: user 78.1 ms, sys: 46.9 ms, total: 125 ms\nWall time: 4.46 s\n{'assemblies': [{'assembly_id': '1',\n                 'form': 'Non-polymer only',\n                 'name': '240-mer',\n                 'preferred': True},\n                {'assembly_id': '2',\n                 'form': 'Non-polymer only',\n                 'name': 'tetramer',\n                 'preferred': False},\n                {'assembly_id': '3',\n                 'form': 'Non-polymer only',\n                 'name': 'icosamer',\n                 'preferred': False},\n                {'assembly_id': '4',\n                 'form': 'Non-polymer only',\n                 'name': '24-mer',\n                 'preferred': False},\n                {'assembly_id': '5',\n                 'form': 'Non-polymer only',\n                 'name': 'tetramer',\n                 'preferred': False}],\n 'deposition_date': '20020617',\n 'deposition_site': 'RCSB',\n 'entry_authors': ['He, Y.',\n                   'Lin, F.',\n                   'Chipman, P.R.',\n                   'Bator, C.M.',\n                   'Baker, T.S.',\n                   'Shoham, M.',\n                   'Kuhn, R.J.',\n                   'Medof, M.E.',\n                   'Rossmann, M.G.'],\n 'experimental_method': ['Electron Microscopy'],\n 'experimental_method_class': ['em'],\n 'number_of_entities': {'carbohydrate_polymer': 0,\n                        'dna': 0,\n                        'dna/rna': 0,\n                        'ligand': 0,\n                        'other': 0,\n                        'polypeptide': 4,\n                        'rna': 0,\n                        'sugar': 0,\n                        'water': 0},\n 'processing_site': 'RCSB',\n 'related_structures': [],\n 'release_date': '20020828',\n 'revision_date': '20180718',\n 'split_entry': [],\n 'title': 'structural model of human decay-accelerating factor bound to '\n          'echovirus 7 from cryo-electron microscopy'}\nCPU times: user 15.6 ms, sys: 15.6 ms, total: 31.2 ms\nWall time: 15.3 ms\n"
    }
   ],
   "source": [
    "%time pprint(pdb_demo_existing.status)\n",
    "%time pprint(pdb_demo_existing.summary)\n",
    "\n",
    "%time pprint(pdb_demo_new.status)\n",
    "%time pprint(pdb_demo_new.summary)"
   ]
  },
  {
   "source": [
    "#### Explicit implementation"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "CPU times: user 0 ns, sys: 15.6 ms, total: 15.6 ms\nWall time: 33.2 ms\n"
    },
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "     author_insertion_code  author_residue_number  multiple_conformers  \\\n0                                             225                  NaN   \n1                                             226                  NaN   \n2                                             227                  NaN   \n3                                             228                  NaN   \n4                                             229                  NaN   \n...                    ...                    ...                  ...   \n1234                                          164                  NaN   \n1235                                          165                  NaN   \n1236                                          166                  NaN   \n1237                                          167                  NaN   \n1238                                          168                  NaN   \n\n      observed_ratio residue_name  residue_number chain_id struct_asym_id  \\\n0                  1          GLU             201        A              A   \n1                  1          TYR             202        A              A   \n2                  1          LEU             203        A              A   \n3                  1          ILE             204        A              A   \n4                  1          GLU             205        A              A   \n...              ...          ...             ...      ...            ...   \n1234               1          PRO             140        B              B   \n1235               1          LEU             141        B              B   \n1236               1          ILE             142        B              B   \n1237               1          ALA             143        B              B   \n1238               1          LEU             144        B              B   \n\n     entity_id pdb_id  \n0            1   1m4x  \n1            1   1m4x  \n2            1   1m4x  \n3            1   1m4x  \n4            1   1m4x  \n...        ...    ...  \n1234         1   1m4x  \n1235         1   1m4x  \n1236         1   1m4x  \n1237         1   1m4x  \n1238         1   1m4x  \n\n[1239 rows x 10 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>author_insertion_code</th>\n      <th>author_residue_number</th>\n      <th>multiple_conformers</th>\n      <th>observed_ratio</th>\n      <th>residue_name</th>\n      <th>residue_number</th>\n      <th>chain_id</th>\n      <th>struct_asym_id</th>\n      <th>entity_id</th>\n      <th>pdb_id</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td></td>\n      <td>225</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>GLU</td>\n      <td>201</td>\n      <td>A</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td></td>\n      <td>226</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>TYR</td>\n      <td>202</td>\n      <td>A</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td></td>\n      <td>227</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>LEU</td>\n      <td>203</td>\n      <td>A</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td></td>\n      <td>228</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>ILE</td>\n      <td>204</td>\n      <td>A</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td></td>\n      <td>229</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>GLU</td>\n      <td>205</td>\n      <td>A</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1234</th>\n      <td></td>\n      <td>164</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>PRO</td>\n      <td>140</td>\n      <td>B</td>\n      <td>B</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>1235</th>\n      <td></td>\n      <td>165</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>LEU</td>\n      <td>141</td>\n      <td>B</td>\n      <td>B</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>1236</th>\n      <td></td>\n      <td>166</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>ILE</td>\n      <td>142</td>\n      <td>B</td>\n      <td>B</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>1237</th>\n      <td></td>\n      <td>167</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>ALA</td>\n      <td>143</td>\n      <td>B</td>\n      <td>B</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>1238</th>\n      <td></td>\n      <td>168</td>\n      <td>NaN</td>\n      <td>1</td>\n      <td>LEU</td>\n      <td>144</td>\n      <td>B</td>\n      <td>B</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n  </tbody>\n</table>\n<p>1239 rows × 10 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 7
    }
   ],
   "source": [
    "%time pdb_demo_existing.fetch_from_web_api('api/pdb/entry/residue_listing/', PDB.to_dataframe).result()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "CPU times: user 78.1 ms, sys: 46.9 ms, total: 125 ms\nWall time: 2.6 s\n"
    },
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "     author_insertion_code  author_residue_number  multiple_conformers  \\\n0                                             192                  NaN   \n1                                             193                  NaN   \n2                                             194                  NaN   \n3                                             195                  NaN   \n4                                             196                  NaN   \n...                    ...                    ...                  ...   \n1008                                          234                  NaN   \n1009                                          235                  NaN   \n1010                                          236                  NaN   \n1011                                          237                  NaN   \n1012                                          238                  NaN   \n\n      observed_ratio residue_name  residue_number chain_id struct_asym_id  \\\n0              0.142          PRO             192        R              A   \n1              0.200          ALA             193        R              A   \n2              0.142          PRO             194        R              A   \n3              0.142          PRO             195        R              A   \n4              0.111          GLN             196        R              A   \n...              ...          ...             ...      ...            ...   \n1008           0.142          THR             234        3              D   \n1009           0.200          ALA             235        3              D   \n1010           0.125          LEU             236        3              D   \n1011           0.125          LEU             237        3              D   \n1012           0.100          GLN             238        3              D   \n\n     entity_id pdb_id  \n0            1   1m11  \n1            1   1m11  \n2            1   1m11  \n3            1   1m11  \n4            1   1m11  \n...        ...    ...  \n1008         4   1m11  \n1009         4   1m11  \n1010         4   1m11  \n1011         4   1m11  \n1012         4   1m11  \n\n[1013 rows x 10 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>author_insertion_code</th>\n      <th>author_residue_number</th>\n      <th>multiple_conformers</th>\n      <th>observed_ratio</th>\n      <th>residue_name</th>\n      <th>residue_number</th>\n      <th>chain_id</th>\n      <th>struct_asym_id</th>\n      <th>entity_id</th>\n      <th>pdb_id</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td></td>\n      <td>192</td>\n      <td>NaN</td>\n      <td>0.142</td>\n      <td>PRO</td>\n      <td>192</td>\n      <td>R</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td></td>\n      <td>193</td>\n      <td>NaN</td>\n      <td>0.200</td>\n      <td>ALA</td>\n      <td>193</td>\n      <td>R</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td></td>\n      <td>194</td>\n      <td>NaN</td>\n      <td>0.142</td>\n      <td>PRO</td>\n      <td>194</td>\n      <td>R</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td></td>\n      <td>195</td>\n      <td>NaN</td>\n      <td>0.142</td>\n      <td>PRO</td>\n      <td>195</td>\n      <td>R</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td></td>\n      <td>196</td>\n      <td>NaN</td>\n      <td>0.111</td>\n      <td>GLN</td>\n      <td>196</td>\n      <td>R</td>\n      <td>A</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1008</th>\n      <td></td>\n      <td>234</td>\n      <td>NaN</td>\n      <td>0.142</td>\n      <td>THR</td>\n      <td>234</td>\n      <td>3</td>\n      <td>D</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>1009</th>\n      <td></td>\n      <td>235</td>\n      <td>NaN</td>\n      <td>0.200</td>\n      <td>ALA</td>\n      <td>235</td>\n      <td>3</td>\n      <td>D</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>1010</th>\n      <td></td>\n      <td>236</td>\n      <td>NaN</td>\n      <td>0.125</td>\n      <td>LEU</td>\n      <td>236</td>\n      <td>3</td>\n      <td>D</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>1011</th>\n      <td></td>\n      <td>237</td>\n      <td>NaN</td>\n      <td>0.125</td>\n      <td>LEU</td>\n      <td>237</td>\n      <td>3</td>\n      <td>D</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>1012</th>\n      <td></td>\n      <td>238</td>\n      <td>NaN</td>\n      <td>0.100</td>\n      <td>GLN</td>\n      <td>238</td>\n      <td>3</td>\n      <td>D</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n  </tbody>\n</table>\n<p>1013 rows × 10 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 8
    }
   ],
   "source": [
    "%time pdb_demo_new.fetch_from_web_api('api/pdb/entry/residue_listing/', PDB.to_dataframe).result()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "CPU times: user 31.2 ms, sys: 15.6 ms, total: 46.9 ms\nWall time: 48.9 ms\n{0: <PDBAssemble 1m4x/0>,\n 1: <PDBAssemble 1m4x/1>,\n 2: <PDBAssemble 1m4x/2>,\n 3: <PDBAssemble 1m4x/3>,\n 4: <PDBAssemble 1m4x/4>,\n 5: <PDBAssemble 1m4x/5>,\n 6: <PDBAssemble 1m4x/6>,\n 7: <PDBAssemble 1m4x/7>}\nCPU times: user 46.9 ms, sys: 15.6 ms, total: 62.5 ms\nWall time: 2.51 s\n{0: <PDBAssemble 1m11/0>,\n 1: <PDBAssemble 1m11/1>,\n 2: <PDBAssemble 1m11/2>,\n 3: <PDBAssemble 1m11/3>,\n 4: <PDBAssemble 1m11/4>,\n 5: <PDBAssemble 1m11/5>}\n"
    }
   ],
   "source": [
    "%time pdb_demo_existing.set_assembly().result()\n",
    "pprint(pdb_demo_existing.assembly)\n",
    "\n",
    "%time pdb_demo_new.set_assembly().result()\n",
    "pprint(pdb_demo_new.assembly)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "CPU times: user 15.6 ms, sys: 15.6 ms, total: 31.2 ms\nWall time: 15.8 ms\n"
    },
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "  entity_id                                          in_chains  \\\n0         1  [\"A\",\"AA\",\"AAA\",\"AAAA\",\"AAAB\",\"AAAC\",\"AAAD\",\"A...   \n1         1  [\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...   \n2         1  [\"A\",\"AA\",\"AAA\",\"AB\",\"AC\",\"AD\",\"AE\",\"AF\",\"AG\",...   \n3         1  [\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AB\",\"AC\",\"AD\",\"AE...   \n4         1  [\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...   \n5         1  [\"A\",\"AA\",\"AAA\",\"AB\",\"AC\",\"AD\",\"AE\",\"AF\",\"AG\",...   \n6         1  [\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...   \n\n              molecule_name   molecule_type  number_of_copies  \\\n0  [\"Major capsid protein\"]  polypeptide(L)              5040   \n1  [\"Major capsid protein\"]  polypeptide(L)               420   \n2  [\"Major capsid protein\"]  polypeptide(L)                84   \n3  [\"Major capsid protein\"]  polypeptide(L)                90   \n4  [\"Major capsid protein\"]  polypeptide(L)               504   \n5  [\"Major capsid protein\"]  polypeptide(L)                84   \n6  [\"Major capsid protein\"]  polypeptide(L)               198   \n\n   polymeric_count assembly_composition  molecular_weight  \\\n0             5040    protein structure        230503.860   \n1              420    protein structure         19208.654   \n2               84    protein structure          3841.731   \n3               90    protein structure          4116.140   \n4              504    protein structure         23050.387   \n5               84    protein structure          3841.731   \n6              198    protein structure          9055.508   \n\n                                        details  assembly_id pdb_id  \n0                 complete icosahedral assembly            1   1m4x  \n1                          icosahedral pentamer            3   1m4x  \n2                   icosahedral asymmetric unit            2   1m4x  \n3                    pentasymmetron capsid unit            5   1m4x  \n4                        icosahedral 23 hexamer            4   1m4x  \n5  icosahedral asymmetric unit, std point frame            7   1m4x  \n6                      trisymmetron capsid unit            6   1m4x  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>entity_id</th>\n      <th>in_chains</th>\n      <th>molecule_name</th>\n      <th>molecule_type</th>\n      <th>number_of_copies</th>\n      <th>polymeric_count</th>\n      <th>assembly_composition</th>\n      <th>molecular_weight</th>\n      <th>details</th>\n      <th>assembly_id</th>\n      <th>pdb_id</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AAAA\",\"AAAB\",\"AAAC\",\"AAAD\",\"A...</td>\n      <td>[\"Major capsid protein\"]</td>\n      <td>polypeptide(L)</td>\n      <td>5040</td>\n      <td>5040</td>\n      <td>protein structure</td>\n      <td>230503.860</td>\n      <td>complete icosahedral assembly</td>\n      <td>1</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...</td>\n      <td>[\"Major capsid protein\"]</td>\n      <td>polypeptide(L)</td>\n      <td>420</td>\n      <td>420</td>\n      <td>protein structure</td>\n      <td>19208.654</td>\n      <td>icosahedral pentamer</td>\n      <td>3</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AB\",\"AC\",\"AD\",\"AE\",\"AF\",\"AG\",...</td>\n      <td>[\"Major capsid protein\"]</td>\n      <td>polypeptide(L)</td>\n      <td>84</td>\n      <td>84</td>\n      <td>protein structure</td>\n      <td>3841.731</td>\n      <td>icosahedral asymmetric unit</td>\n      <td>2</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AB\",\"AC\",\"AD\",\"AE...</td>\n      <td>[\"Major capsid protein\"]</td>\n      <td>polypeptide(L)</td>\n      <td>90</td>\n      <td>90</td>\n      <td>protein structure</td>\n      <td>4116.140</td>\n      <td>pentasymmetron capsid unit</td>\n      <td>5</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...</td>\n      <td>[\"Major capsid protein\"]</td>\n      <td>polypeptide(L)</td>\n      <td>504</td>\n      <td>504</td>\n      <td>protein structure</td>\n      <td>23050.387</td>\n      <td>icosahedral 23 hexamer</td>\n      <td>4</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AB\",\"AC\",\"AD\",\"AE\",\"AF\",\"AG\",...</td>\n      <td>[\"Major capsid protein\"]</td>\n      <td>polypeptide(L)</td>\n      <td>84</td>\n      <td>84</td>\n      <td>protein structure</td>\n      <td>3841.731</td>\n      <td>icosahedral asymmetric unit, std point frame</td>\n      <td>7</td>\n      <td>1m4x</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...</td>\n      <td>[\"Major capsid protein\"]</td>\n      <td>polypeptide(L)</td>\n      <td>198</td>\n      <td>198</td>\n      <td>protein structure</td>\n      <td>9055.508</td>\n      <td>trisymmetron capsid unit</td>\n      <td>6</td>\n      <td>1m4x</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 10
    }
   ],
   "source": [
    "%time pdb_demo_existing.fetch_from_web_api('api/pdb/entry/assembly/', PDB.to_dataframe).result()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "CPU times: user 31.2 ms, sys: 0 ns, total: 31.2 ms\nWall time: 24.2 ms\n"
    },
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   entity_id                                          in_chains  \\\n0          1  [\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...   \n1          2  [\"B\",\"BA\",\"BAA\",\"BAB\",\"BAC\",\"BAD\",\"BAE\",\"BAF\",...   \n2          3  [\"C\",\"CA\",\"CAA\",\"CAB\",\"CAC\",\"CAD\",\"CAE\",\"CAF\",...   \n3          4  [\"D\",\"DA\",\"DAA\",\"DAB\",\"DAC\",\"DAD\",\"DAE\",\"DAF\",...   \n4          1                          [\"A\",\"AA\",\"AB\",\"AC\",\"AD\"]   \n5          2                          [\"B\",\"BA\",\"BB\",\"BC\",\"BD\"]   \n6          3                          [\"C\",\"CA\",\"CB\",\"CC\",\"CD\"]   \n7          4                          [\"D\",\"DA\",\"DB\",\"DC\",\"DD\"]   \n8          1                                              [\"A\"]   \n9          2                                              [\"B\"]   \n10         3                                              [\"C\"]   \n11         4                                              [\"D\"]   \n12         1                                              [\"A\"]   \n13         2                                              [\"B\"]   \n14         3                                              [\"C\"]   \n15         4                                              [\"D\"]   \n16         1                     [\"A\",\"AA\",\"AB\",\"AC\",\"AD\",\"AE\"]   \n17         2                     [\"B\",\"BA\",\"BB\",\"BC\",\"BD\",\"BE\"]   \n18         3                     [\"C\",\"CA\",\"CB\",\"CC\",\"CD\",\"CE\"]   \n19         4                     [\"D\",\"DA\",\"DB\",\"DC\",\"DD\",\"DE\"]   \n\n                               molecule_name   molecule_type  \\\n0   [\"Complement decay-accelerating factor\"]  polypeptide(L)   \n1                       [\"COAT PROTEIN VP1\"]  polypeptide(L)   \n2                       [\"COAT PROTEIN VP2\"]  polypeptide(L)   \n3                       [\"COAT PROTEIN VP3\"]  polypeptide(L)   \n4   [\"Complement decay-accelerating factor\"]  polypeptide(L)   \n5                       [\"COAT PROTEIN VP1\"]  polypeptide(L)   \n6                       [\"COAT PROTEIN VP2\"]  polypeptide(L)   \n7                       [\"COAT PROTEIN VP3\"]  polypeptide(L)   \n8   [\"Complement decay-accelerating factor\"]  polypeptide(L)   \n9                       [\"COAT PROTEIN VP1\"]  polypeptide(L)   \n10                      [\"COAT PROTEIN VP2\"]  polypeptide(L)   \n11                      [\"COAT PROTEIN VP3\"]  polypeptide(L)   \n12  [\"Complement decay-accelerating factor\"]  polypeptide(L)   \n13                      [\"COAT PROTEIN VP1\"]  polypeptide(L)   \n14                      [\"COAT PROTEIN VP2\"]  polypeptide(L)   \n15                      [\"COAT PROTEIN VP3\"]  polypeptide(L)   \n16  [\"Complement decay-accelerating factor\"]  polypeptide(L)   \n17                      [\"COAT PROTEIN VP1\"]  polypeptide(L)   \n18                      [\"COAT PROTEIN VP2\"]  polypeptide(L)   \n19                      [\"COAT PROTEIN VP3\"]  polypeptide(L)   \n\n    number_of_copies  polymeric_count     assembly_composition  \\\n0                 60              240  protein/protein complex   \n1                 60              240  protein/protein complex   \n2                 60              240  protein/protein complex   \n3                 60              240  protein/protein complex   \n4                  5               20  protein/protein complex   \n5                  5               20  protein/protein complex   \n6                  5               20  protein/protein complex   \n7                  5               20  protein/protein complex   \n8                  1                4  protein/protein complex   \n9                  1                4  protein/protein complex   \n10                 1                4  protein/protein complex   \n11                 1                4  protein/protein complex   \n12                 1                4  protein/protein complex   \n13                 1                4  protein/protein complex   \n14                 1                4  protein/protein complex   \n15                 1                4  protein/protein complex   \n16                 6               24  protein/protein complex   \n17                 6               24  protein/protein complex   \n18                 6               24  protein/protein complex   \n19                 6               24  protein/protein complex   \n\n    molecular_weight                                       details  \\\n0           6804.412                 complete icosahedral assembly   \n1           6804.412                 complete icosahedral assembly   \n2           6804.412                 complete icosahedral assembly   \n3           6804.412                 complete icosahedral assembly   \n4            567.034                          icosahedral pentamer   \n5            567.034                          icosahedral pentamer   \n6            567.034                          icosahedral pentamer   \n7            567.034                          icosahedral pentamer   \n8            113.407                   icosahedral asymmetric unit   \n9            113.407                   icosahedral asymmetric unit   \n10           113.407                   icosahedral asymmetric unit   \n11           113.407                   icosahedral asymmetric unit   \n12           113.407  icosahedral asymmetric unit, std point frame   \n13           113.407  icosahedral asymmetric unit, std point frame   \n14           113.407  icosahedral asymmetric unit, std point frame   \n15           113.407  icosahedral asymmetric unit, std point frame   \n16           680.441                        icosahedral 23 hexamer   \n17           680.441                        icosahedral 23 hexamer   \n18           680.441                        icosahedral 23 hexamer   \n19           680.441                        icosahedral 23 hexamer   \n\n    assembly_id pdb_id  \n0             1   1m11  \n1             1   1m11  \n2             1   1m11  \n3             1   1m11  \n4             3   1m11  \n5             3   1m11  \n6             3   1m11  \n7             3   1m11  \n8             2   1m11  \n9             2   1m11  \n10            2   1m11  \n11            2   1m11  \n12            5   1m11  \n13            5   1m11  \n14            5   1m11  \n15            5   1m11  \n16            4   1m11  \n17            4   1m11  \n18            4   1m11  \n19            4   1m11  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>entity_id</th>\n      <th>in_chains</th>\n      <th>molecule_name</th>\n      <th>molecule_type</th>\n      <th>number_of_copies</th>\n      <th>polymeric_count</th>\n      <th>assembly_composition</th>\n      <th>molecular_weight</th>\n      <th>details</th>\n      <th>assembly_id</th>\n      <th>pdb_id</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AAA\",\"AAB\",\"AAC\",\"AAD\",\"AAE\",\"AAF\",...</td>\n      <td>[\"Complement decay-accelerating factor\"]</td>\n      <td>polypeptide(L)</td>\n      <td>60</td>\n      <td>240</td>\n      <td>protein/protein complex</td>\n      <td>6804.412</td>\n      <td>complete icosahedral assembly</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>[\"B\",\"BA\",\"BAA\",\"BAB\",\"BAC\",\"BAD\",\"BAE\",\"BAF\",...</td>\n      <td>[\"COAT PROTEIN VP1\"]</td>\n      <td>polypeptide(L)</td>\n      <td>60</td>\n      <td>240</td>\n      <td>protein/protein complex</td>\n      <td>6804.412</td>\n      <td>complete icosahedral assembly</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>[\"C\",\"CA\",\"CAA\",\"CAB\",\"CAC\",\"CAD\",\"CAE\",\"CAF\",...</td>\n      <td>[\"COAT PROTEIN VP2\"]</td>\n      <td>polypeptide(L)</td>\n      <td>60</td>\n      <td>240</td>\n      <td>protein/protein complex</td>\n      <td>6804.412</td>\n      <td>complete icosahedral assembly</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>4</td>\n      <td>[\"D\",\"DA\",\"DAA\",\"DAB\",\"DAC\",\"DAD\",\"DAE\",\"DAF\",...</td>\n      <td>[\"COAT PROTEIN VP3\"]</td>\n      <td>polypeptide(L)</td>\n      <td>60</td>\n      <td>240</td>\n      <td>protein/protein complex</td>\n      <td>6804.412</td>\n      <td>complete icosahedral assembly</td>\n      <td>1</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AB\",\"AC\",\"AD\"]</td>\n      <td>[\"Complement decay-accelerating factor\"]</td>\n      <td>polypeptide(L)</td>\n      <td>5</td>\n      <td>20</td>\n      <td>protein/protein complex</td>\n      <td>567.034</td>\n      <td>icosahedral pentamer</td>\n      <td>3</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>2</td>\n      <td>[\"B\",\"BA\",\"BB\",\"BC\",\"BD\"]</td>\n      <td>[\"COAT PROTEIN VP1\"]</td>\n      <td>polypeptide(L)</td>\n      <td>5</td>\n      <td>20</td>\n      <td>protein/protein complex</td>\n      <td>567.034</td>\n      <td>icosahedral pentamer</td>\n      <td>3</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>3</td>\n      <td>[\"C\",\"CA\",\"CB\",\"CC\",\"CD\"]</td>\n      <td>[\"COAT PROTEIN VP2\"]</td>\n      <td>polypeptide(L)</td>\n      <td>5</td>\n      <td>20</td>\n      <td>protein/protein complex</td>\n      <td>567.034</td>\n      <td>icosahedral pentamer</td>\n      <td>3</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>4</td>\n      <td>[\"D\",\"DA\",\"DB\",\"DC\",\"DD\"]</td>\n      <td>[\"COAT PROTEIN VP3\"]</td>\n      <td>polypeptide(L)</td>\n      <td>5</td>\n      <td>20</td>\n      <td>protein/protein complex</td>\n      <td>567.034</td>\n      <td>icosahedral pentamer</td>\n      <td>3</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>1</td>\n      <td>[\"A\"]</td>\n      <td>[\"Complement decay-accelerating factor\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit</td>\n      <td>2</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>2</td>\n      <td>[\"B\"]</td>\n      <td>[\"COAT PROTEIN VP1\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit</td>\n      <td>2</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>3</td>\n      <td>[\"C\"]</td>\n      <td>[\"COAT PROTEIN VP2\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit</td>\n      <td>2</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>4</td>\n      <td>[\"D\"]</td>\n      <td>[\"COAT PROTEIN VP3\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit</td>\n      <td>2</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>1</td>\n      <td>[\"A\"]</td>\n      <td>[\"Complement decay-accelerating factor\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit, std point frame</td>\n      <td>5</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>2</td>\n      <td>[\"B\"]</td>\n      <td>[\"COAT PROTEIN VP1\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit, std point frame</td>\n      <td>5</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>3</td>\n      <td>[\"C\"]</td>\n      <td>[\"COAT PROTEIN VP2\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit, std point frame</td>\n      <td>5</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>4</td>\n      <td>[\"D\"]</td>\n      <td>[\"COAT PROTEIN VP3\"]</td>\n      <td>polypeptide(L)</td>\n      <td>1</td>\n      <td>4</td>\n      <td>protein/protein complex</td>\n      <td>113.407</td>\n      <td>icosahedral asymmetric unit, std point frame</td>\n      <td>5</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>1</td>\n      <td>[\"A\",\"AA\",\"AB\",\"AC\",\"AD\",\"AE\"]</td>\n      <td>[\"Complement decay-accelerating factor\"]</td>\n      <td>polypeptide(L)</td>\n      <td>6</td>\n      <td>24</td>\n      <td>protein/protein complex</td>\n      <td>680.441</td>\n      <td>icosahedral 23 hexamer</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>2</td>\n      <td>[\"B\",\"BA\",\"BB\",\"BC\",\"BD\",\"BE\"]</td>\n      <td>[\"COAT PROTEIN VP1\"]</td>\n      <td>polypeptide(L)</td>\n      <td>6</td>\n      <td>24</td>\n      <td>protein/protein complex</td>\n      <td>680.441</td>\n      <td>icosahedral 23 hexamer</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>18</th>\n      <td>3</td>\n      <td>[\"C\",\"CA\",\"CB\",\"CC\",\"CD\",\"CE\"]</td>\n      <td>[\"COAT PROTEIN VP2\"]</td>\n      <td>polypeptide(L)</td>\n      <td>6</td>\n      <td>24</td>\n      <td>protein/protein complex</td>\n      <td>680.441</td>\n      <td>icosahedral 23 hexamer</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>4</td>\n      <td>[\"D\",\"DA\",\"DB\",\"DC\",\"DD\",\"DE\"]</td>\n      <td>[\"COAT PROTEIN VP3\"]</td>\n      <td>polypeptide(L)</td>\n      <td>6</td>\n      <td>24</td>\n      <td>protein/protein complex</td>\n      <td>680.441</td>\n      <td>icosahedral 23 hexamer</td>\n      <td>4</td>\n      <td>1m11</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 11
    }
   ],
   "source": [
    "%time pdb_demo_new.fetch_from_web_api('api/pdb/entry/assembly/', PDB.to_dataframe).result()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "output_type": "display_data",
     "data": {
      "text/plain": "<IPython.core.display.HTML object>",
      "text/html": "\n        <table align=\"center\">\n            <tr>\n            \n                <td>\n                    <b>Asymmetric unit</b> of 1m4x\n                </td>\n    \n                <td>\n                    <b>Biological assembly 1</b> of 1m4x\n                </td>\n    \n                <td>\n                    <b>Biological assembly 2</b> of 1m4x\n                </td>\n    \n                <td>\n                    <b>Biological assembly 3</b> of 1m4x\n                </td>\n    \n                <td>\n                    <b>Biological assembly 4</b> of 1m4x\n                </td>\n    \n                <td>\n                    <b>Biological assembly 5</b> of 1m4x\n                </td>\n    \n                <td>\n                    <b>Biological assembly 6</b> of 1m4x\n                </td>\n    \n                <td>\n                    <b>Biological assembly 7</b> of 1m4x\n                </td>\n    \n            </tr>\n            <tr>\n            \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_model-1.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_assembly-1.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_assembly-2.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_assembly-3.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_assembly-4.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_assembly-5.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_assembly-6.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m4/1m4x/1m4x_assembly-7.jpeg\"/>\n                </td>\n    \n            </tr>\n        </table>\n        "
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": "<IPython.core.display.HTML object>",
      "text/html": "\n        <table align=\"center\">\n            <tr>\n            \n                <td>\n                    <b>Asymmetric unit</b> of 1m11\n                </td>\n    \n                <td>\n                    <b>Biological assembly 1</b> of 1m11\n                </td>\n    \n                <td>\n                    <b>Biological assembly 2</b> of 1m11\n                </td>\n    \n                <td>\n                    <b>Biological assembly 3</b> of 1m11\n                </td>\n    \n                <td>\n                    <b>Biological assembly 4</b> of 1m11\n                </td>\n    \n                <td>\n                    <b>Biological assembly 5</b> of 1m11\n                </td>\n    \n            </tr>\n            <tr>\n            \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m1/1m11/1m11_model-1.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m1/1m11/1m11_assembly-1.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m1/1m11/1m11_assembly-2.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m1/1m11/1m11_assembly-3.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m1/1m11/1m11_assembly-4.jpeg\"/>\n                </td>\n    \n                <td>\n                    <img width=\"300em\" src=\"https://cdn.rcsb.org/images/structures/m1/1m11/1m11_assembly-5.jpeg\"/>\n                </td>\n    \n            </tr>\n        </table>\n        "
     },
     "metadata": {}
    },
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "<pdb_profiling.utils.DisplayPDB at 0x7fb044dcda00>"
     },
     "metadata": {},
     "execution_count": 12
    }
   ],
   "source": [
    "DisplayPDB(pdb_demo_existing.pdb_id, pdb_demo_existing.assembly.keys())\n",
    "DisplayPDB(pdb_demo_new.pdb_id, pdb_demo_new.assembly.keys())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}